import axios from '../utils/request'

const base = {
	baseUrl:'http://api.tianapi.com',
	juheBaseUrl:'/juhe_api',
	// /api
	juheUrl:'http://apis.juhe.cn',
	ncov:'/ncov/index',
	city:'https://grnx.api.storeapi.net/api/94/219',
	ncovabroad:'/ncovabroad/index',
	travelCity:'/springTravel/citys',
	traveQuery:'/springTravel/query'
}

// 获取数据
const api = {
	// 疫情信息
	getNcov(params){
		return axios.get(base.baseUrl + base.ncov, {
			params
		})
	},
	//省市疫情
	getCity(params){
		return axios.get(base.city,{
			params
		})
	},
	//世界疫情
	getNcovabroad(params){
		return axios.get(base.baseUrl + base.ncovabroad,{
			params
		})
	},
	//各地城市
	getTravelCity(params){
		return axios.get(base.juheBaseUrl+base.travelCity,{
			params
		})
	},
	getTravelQuery(params){
		return axios.get(base.juheBaseUrl+base.traveQuery,{
			params
		})
	}
}

// 导出api
export default api;
